<template >
    <basiccard :header_nav="header_nav">
         <el-table
    :data="rightList"
    border
     stripe >
    <el-table-column
    type="index"
>
    </el-table-column>
    <el-table-column
      prop="authName"
      label="权限名称"
>
    </el-table-column>
    <el-table-column
      prop="path"
      label="路径"
>
    </el-table-column>
    <el-table-column
      prop="level"
      label="权限等级"
>
<template slot-scope="scope">

   <el-tag type="success" v-if="scope.row.level==0" >一级权限</el-tag>
   <el-tag type="warning" v-else-if="scope.row.level==1" >二级权限</el-tag>
   <el-tag type="danger" v-else >三级权限</el-tag>
   
</template>
    </el-table-column>
  </el-table>
   </basiccard>
</template>
<script>
export default {
    name:'rights',
      // 传给基础组件的值
      data() {
          return {
                header_nav:{
                 path:'/rights',
                 rolesMge:'权限管理',
                 rolesList:'权限列表',
            },
            rightList:[]
          }
      },
      methods: {
          
          async getRightsList() {
            const {data:res} =  await  this.$http.get(`rights/list`)
            if(res.meta.status!==200) return this.$message.error('获取权限列表失败')
             this.rightList = res.data
             console.log(res.data);
             
     
           }
      },
      created() {
          this.getRightsList()
      },
          

}
</script>
<style lang="scss" scoped>
    
</style>